const getStackStatus = (zt: any) => {
    const temp = zt ? zt * 1 : '-9999'
    switch (temp) {
        case 180:
            return '已出报告'
        case 190:
            return '未归档'
        case 191:
            return '191'
        case 192:
            return '已提交归档'
        case 193:
            return '质监已审批'
        case 200:
            return '已归档'
        case 210:
            return '档案迁移中'
        case 300:
            return '历史档案'
        default:
            return `未知(${temp})`
    }
}

export function fixTreeData(treeData: any[], idKey?: string, parentIdKey?: string) {
    let ID = idKey || 'id';
    let PID = parentIdKey || 'pid';
    // 找到所有断层节点
    const brokenNodes = treeData.filter((node: any) => node[ID] && !treeData.find((parent: any) => parent[ID] === node[PID]));
    brokenNodes.forEach((node: any) => {
        node[PID] = null;
    });
    return treeData;
}

export { getStackStatus };



